package com.qf.cqut.Service.impl;

import com.qf.cqut.Service.ReturnService;
import com.qf.cqut.mapper.AReturnMapper;
import com.qf.cqut.model.pojo.AReturn;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ReturnServiceImpl implements ReturnService {

    @Resource
    private AReturnMapper aReturnMapper;


    @Override
    public List<AReturn> selectByLimit(Integer page, Integer limit) {
        if(page != null && limit != null){
            page = (page - 1) * limit;
        }else{
            page = 0;
            limit = 10;
        }
        return aReturnMapper.selectByLimit(page,limit);
    }

    @Override
    public Integer count() {
        return aReturnMapper.count();
    }

    @Override
    public Integer delByIds(String[] ids) {
        return aReturnMapper.deleteByIds(ids);
    }

    @Override
    public Integer addAreturn(AReturn aReturn) {
        return aReturnMapper.addAreturn(aReturn);
    }

    @Override
    public Integer editAreturn(AReturn aReturn) {
        return aReturnMapper.editAreturn(aReturn);
    }

    @Override
    public List<AReturn> queryByConditions(AReturn aReturn) {
        return aReturnMapper.queryByConditions(aReturn);
    }
}
